package kr.hkit.androidcomplete01.ch11;

import kr.hkit.androidcomplete01.R;
import kr.hkit.androidcomplete01.ch09.ContextMenuTestEx;
import kr.hkit.androidcomplete01.ch09.MenuCheckEx;
import kr.hkit.androidcomplete01.ch09.OptionMenuEx;
import kr.hkit.androidcomplete01.ch09.OptionMenuXMLEx;
import kr.hkit.androidcomplete01.ch09.PopupMenuTestEx;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class Ch11Main extends ListActivity {
	
	private String[] subList;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		subList = getResources().getStringArray(R.array.ch11_list);

		ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
				android.R.layout.simple_list_item_1, subList);
		setListAdapter(adapter);
	}

	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		super.onListItemClick(l, v, position, id);

		Intent intent = null;

		switch (position) {
		case 0:
			intent = new Intent(this, ReadResourceEx.class);
			break;
		case 1:
			intent = new Intent(this, StyleTestEx.class);
			break;
		case 2:
			intent = new Intent(this, SystemThemeEx.class);
			break;
		case 3:
			intent = new Intent(this, TextViewAttrEx.class);
			break;
		case 4:
			intent = new Intent(this, SpannableTest2Ex.class);
			break;
		case 5:
			intent = new Intent(this, TextViewHtmlEx.class);
			break;
		case 6:
			intent = new Intent(this, EditableTestEx.class);
			break;
		case 7:
			intent = new Intent(this, TextChangeEx.class);
			break;
		case 8:
			intent = new Intent(this, EditLimitEx.class);
			break;
		case 9:
			intent = new Intent(this, EditSelectEx.class);
			break;
		case 10:
			intent = new Intent(this, InputTypeTestEx.class);
			break;
		case 11:
			intent = new Intent(this, ShowHideKeyEx.class);
			break;
		case 12:
			intent = new Intent(this, AdjustKey2Ex.class);
			break;
		case 13:
			intent = new Intent(this, YesNinePatchEx.class);
			break;
		case 14:
			intent = new Intent(this, RadioCheckEx.class);
			break;
		case 15:
			intent = new Intent(this, GramPriceEx.class);
			break;
		case 16:
			intent = new Intent(this, ButtonDrawableEx.class);
			break;
		case 17:
			intent = new Intent(this, ButtonSelectorEx.class);
			break;
		default:
			break;
		}
		startActivity(intent);
	}
}
